<jsp:include page="template-top.jsp" />
<%@ page import="edu.cmu.ibill.databeans.User" %>

<!-- user setting page here -->
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/accountsetting.css">

<%
User user = (User) session.getAttribute("user");
	if (user != null) {
%>

	<div class="setting">Account Settings: <%=user.getUserName()%></div>
	
	<dl class="setting">
	<!-- change password -->
	<dt>Change Password</dt>
	<dd>
    <form method="post" id="changepassword" action="changepassword.do">	  
	  <table>
			<tr>
				<td><label for="newpassword">New Password</label> </td>
				<td><input id="newpassword" name="newpassword" value="" tabindex="4" type="password"></td>
			</tr>
			<tr>
				<td><label for="confirmnewpassword">Confirm Password</label></td>
				<td><input id="confirmnewpassword" name="confirmnewpassword" value="" tabindex="5" type="password"></td>
			</tr>
			<tr>
				<td colspan="2" align="right">
					<input id="changepassword_submit" name="Button" value="Change Password" tabindex="6" type="submit">
				</td>
			</tr>
		</table>
    </form>
	</dd>
	
	<!-- notification setting -->
	<dt>Change Report Setting</dt>
	<dd>
    <form method="post" id="changereport" action="changereport.do">	  
	  <table>
			<tr>
				<td><label for="alerts" style="font-size:120%;">Alerts</label> </td>
			</tr>
			<tr>
				<td><label for="alertspend">Alert me when my monthly spendings exceed </label> </td>
				<td>$<input id="alertspend" name="alertspend" value="" tabindex="7" type="text"></td>
			</tr>
			<tr>
				<td><label for="alertdebt">Alert me when my total debts exceed </label> </td>
				<td>$<input id="alertdebt" name="alertdebt" value="" tabindex="8" type="text"></td>
			</tr>
			<tr>
				<td><label for="summaries" style="font-size:120%;">Summaries</label> </td>
			</tr>
			<tr>
				<td><label for="summaries">Send me summary report every</label> </td>
			</tr>
			<tr>
			<td colspan="2"><input type="radio" name="summaryfrequency" value="no" checked> No report
			<input type="radio" name="summaryfrequency" value="week" tabindex="9" > Week
			<input type="radio" name="summaryfrequency" value="month" tabindex="10" > Month
			<input type="radio" name="summaryfrequency" value="quarter" tabindex="11" > Quarter
			<input type="radio" name="summaryfrequency" value="year" tabindex="12" > Year
			</td>
			</tr>
			<tr>
				<td colspan="2" align="right">
					<input id="changepassword_submit" name="Button" value="Make changes" tabindex="13" type="submit">
				</td>
			</tr>
		</table>
    </form>
	</dd>
	</dl>
<%
}
%>
  <script type="text/javascript">
$(document).ready(function() {
	$('.setting').find('dd').hide().end().find('dt').click(function() {
         var answer = $(this).next();
         if (answer.is(':visible')) {
             answer.slideUp();
         } else {
             answer.slideDown();
         }
     });
});
  
</script>
<jsp:include page="template-bottom.jsp" />